package net.jalbum.jprint;

import java.awt.print.PageFormat;

/**
 *
 * @author david
 */
public enum PageLayout {
    one(1,1), two(2,1), four(2,2), six(3,2), eight(4,2), nine(3,3), twelve(4,3), sixteen(4,4), twenty(5,4), twentyfive(5,5), thirty(6,5);

    private final int cols;
    private final int rows;
    
    private PageLayout(int cols, int rows) {
        this.cols = cols;
        this.rows = rows;
    }
    @Override
    public String toString() {
        return toString(PageFormat.LANDSCAPE);
    }

    public String toString(int orientation) {
        int c = orientation == PageFormat.PORTRAIT ? rows : cols;
        int r = orientation == PageFormat.PORTRAIT ? cols : rows;        
        return "" + rows*cols + " (" + c +"x" + r +")";
    }
    
    public int getCols() {
        return cols;
    }   

    public int getRows() {
        return rows;
    }
    
}
